home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / warptris.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1997-05-12  |  3KB  |  101 lines

  1. /* REXX */
  2. Call RxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs"
  3. Call SysLoadFuncs
  4. Call SysCls
  5. Say "Welcome to WarpTris 1.01 installation script!"
  6. Say
  7. Say "If you have an old version of WarpTris installed you can specify the"
  8. Say "directory where that version is installed. Doing that will replace the"
  9. Say "old version and preserve the old high scores."
  10. Say
  11. Say "**Warning!**"
  12. Say "Whatever directory you specify the WarpTris desktop folder will be"
  13. Say "erased if present, and replaced by the new one!"
  14. Say
  15. Say "Do you wish to continue ? (Y/N)"
  16. pull response
  17. if(response <> "Y") then
  18. do 
  19.  exit
  20. end
  21. Say
  22. Say "On what directory do you want me to install WarpTris's files ?"
  23. Say "(If you just press Enter, I will assume the current directory.)"
  24. Parse Pull fullpath
  25.  
  26. if(fullpath \= "") then
  27. do
  28.  Call SysFileTree fullpath, FileDirectory, 'D'    
  29.  If(FileDirectory.0='0') Then
  30.  do 
  31.   Say "The path you specified does not exist."
  32.   Say "I will try to create it."
  33.   Say
  34.   rc = SysMkDir(fullpath)
  35.   if(rc <> 0) then
  36.   do
  37.    Say "There was an error creating de directory you specified."
  38.    Say "The path may be invalid, exiting..."
  39.    exit
  40.   end
  41.   Say "The directory was created successfully."
  42.   Say
  43.   Say "I will now copy the necessary files to the specified directory."
  44.   "copy *.* "||fullpath
  45.  end
  46.  else
  47.  do
  48.   Say "The directory allready exist."
  49.   Say
  50.   Say "I will now copy the necessary files to the specified directory."
  51.   "copy *.* "||fullpath
  52.  end
  53. end
  54.  
  55. if(fullpath = "") then fullpath = Directory()
  56.  
  57. Say
  58. Say "I wil now create on you Desktop a folder with a program object in it,"
  59. Say "that references WarpTris."
  60.  
  61. rc = SysCreateObject("WPFOLDER", "WarpTris 1.01", "<WP_DESKTOP>", "OBJECTID=<WARPTRIS>;", "replace")
  62. if(rc <> 1) then
  63. do 
  64.  Say "There was an error creating the desktop folder, exiting..."
  65.  exit
  66. end
  67.  
  68. rc = SysCreateObject("WPPROGRAM", "WarpTris 1.01", "<WARPTRIS>", "STARTUPDIR="||fullpath||"\;EXENAME="||fullpath||"\WARPTRIS.EXE;PROGTYPE=PM", "replace")
  69. if(rc <> 1) then
  70. do 
  71.  Say "There was an error creating the program object, exiting..."
  72.  exit
  73. end
  74.  
  75. rc = SysCreateObject("WPPROGRAM", "WarpTris Information", "<WARPTRIS>", "STARTUPDIR="||fullpath||"\;EXENAME=VIEW.EXE;PROGTYPE=PM;PARAMETERS=WarpTris.INF", "replace")
  76. if(rc <> 1) then
  77. do 
  78.  Say "There was an error creating the program object, exiting..."
  79.  exit
  80. end
  81.  
  82. rc = SysCreateShadow(fullpath||"\README", "<WARPTRIS>")
  83. if(rc <> 1) then
  84. do
  85.  Say "There was an error creating the README file shadow..."
  86. end
  87.  
  88. rc = SysCreateShadow(fullpath||"\WhatsNew", "<WARPTRIS>")
  89. if(rc <> 1) then
  90. do
  91.  Say "There was an error creating the WhatsNew file shadow..."
  92. end
  93.  
  94. Say
  95. Say "WarpTris was installed successfully!"
  96. Say
  97. Call SysDropFuncs
  98. exit            
  99.  
  100.  
  101.